<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>统计接口测试</title>
    <style>body{font-family:Arial;padding:20px}pre{background:#f5f5f5;padding:10px}</style>
</head>
<body>
    <h1>统计接口测试</h1>
    <button onclick="testSchool()">学校数据统计</button>
    <button onclick="testClass()">班级数据统计</button>
    <button onclick="testDetail()">班级详情统计</button>
    <button onclick="testOffline()">线下教学统计</button>
    <button onclick="testOnline()">线上教学统计</button>
    <button onclick="testCourseQuery()">课程查询</button>
    <button onclick="testAttendance()">考勤查询</button>
    <pre id="out"></pre>
    <script>
        function show(title, data){document.getElementById('out').textContent=title+"\n"+JSON.stringify(data,null,2)}
        function testSchool(){fetch('/ysapi/v1/statistics/schoolStats').then(r=>r.json()).then(d=>show('学校数据统计',d))}
        function testClass(){fetch('/ysapi/v1/statistics/classStats').then(r=>r.json()).then(d=>show('班级数据统计',d))}
        function testDetail(){fetch('/ysapi/v1/statistics/classDetail').then(r=>r.json()).then(d=>show('班级详情统计',d))}
        function testOffline(){fetch('/ysapi/v1/teach/offline').then(r=>r.json()).then(d=>show('线下教学统计',d))}
        function testOnline(){fetch('/ysapi/v1/teach/online').then(r=>r.json()).then(d=>show('线上教学统计',d))}
        function testCourseQuery(){fetch('/ysapi/v1/course/query').then(r=>r.json()).then(d=>show('课程查询',d))}
        function testAttendance(){fetch('/ysapi/v1/attendance/query').then(r=>r.json()).then(d=>show('考勤查询',d))}
    </script>
</body>
</html>